package com.app.manage.task;

import com.app.manage.moudles.push.dao.TCornTaskDao;
import com.app.manage.moudles.push.entity.TCornTask;
import com.app.manage.moudles.push.service.TCornTaskService;
import com.app.manage.moudles.server.service.TServerService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
@Slf4j
public class CheckServerStatusTask {

    @Resource
    private TServerService tServerService;

    @Resource
    private TCornTaskService tCornTaskService;

    @Scheduled(fixedRate = 1000 * 60 )
    public void checkServerTask(){
        log.info("定时任务，检查服务器状态，60s一次");
        tServerService.checkAndUpdStatus();
    }

    @Scheduled(fixedRate = 1000 * 60 * 29 )
    public void  checkPushTask(){
        log.info("定时任务，检查任务状态，29分钟一次");
        tCornTaskService.checkTask();
    }



}
